
public class DLLNode implements IDLLNode {

		//instance variables
	private DLLNode next;
	private DLLNode prev;
	private Record nodeData;

	
	//default constructor
	public DLLNode(){
		next=null;
		prev=null;
		nodeData=new Record();
	}
	//overloaded constructor
	public DLLNode(Record value, DLLNode successor){
		nodeData=value;
		next=successor;
	}
	
	//accessors
	public DLLNode getNext(){
		return next;
	}
	public DLLNode getPrev(){
		return prev;
	}
	public Record getNodeData(){
		return nodeData;
	}
	//mutators
	public void setNext(DLLNode newNext){
		next=newNext;
	}
	public void setPrev(DLLNode newPrev){
		prev=newPrev;
	}
	public void setNodeData(Record what){
		nodeData=what;
	}
	
		//General Methods
	
	//converts a particular node to a String, called in DLL Class
	public String toString(int counter){
		
		String a="";			//String to be returned
		
				//if node is head
			if(this.getPrev()==null){
			
				a+="\n"+counter+":Dummy Node";
			}
				//if node is tail
			else if(this.getNext()==null){
				a+="\n"+counter+":Dummy Node";
			}
				//if node is anything besides head or tail
			else{
				a+="\n"+counter+":"+nodeData.toString();
			}
			
					
				
			
		
		
		return a;
	}
	
}
